package hlhj.fhp.checkpoint.adp

import android.support.v7.widget.RecyclerView
import android.view.View
import android.widget.LinearLayout
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.liaoinstan.springview.utils.DensityUtil
import hlhj.fhp.checkpoint.R

/**
 * Created by Never Fear   on 2018\12\5 0005.
Never More....
 */
class TestAdp(private val datas:ArrayList<String>) :BaseQuickAdapter<String,BaseViewHolder>(R.layout.test_item,datas) {
    override fun convert(helper: BaseViewHolder?, item: String?) {
        val itemView = helper?.itemView
        val params = itemView?.layoutParams as RecyclerView.LayoutParams
        val loDv = helper?.getView<View>(R.id.loDv)

        when(helper?.adapterPosition){
            0->{
                loDv.visibility=View.VISIBLE
                params.setMargins(0,0,0,0)

            }
            else->{
                loDv.visibility=View.GONE
                params.setMargins(0,-DensityUtil.dip2px(mContext,10f),0,0)
            }
        }
        itemView.layoutParams=params

    }

}